#!/bin/sh

export CFLG="-D___SYS_I486 -D___OS_LIN"
export LIBS="-lm -ldl -lpthread"
export LIBS="$LIBS -lgcc -lc -lgcc"

if [ "$1" == "-prof" ]; then
  export COPT="-g -pg"
  shift
else
  export COPT="-s"
fi
if [ "$1" == "" ]; then
  echo "Args: [-prof] <name>"
  exit 0
fi
export NAM=$1
shift

echo CFLG=$CFLG
gcc $COPT -O2 -Wall -o $NAM.x $CFLG $NAM.c $LIBS
#./jpeg.x $*; gprof jpeg.x gmon.out >zz1
